/*
 * @message: 描述
 * @Author: Roy
 * @Email: cx_love_xc@163.com
 * @Github: cx_love_xc@163.com
 * @Date: 2022-01-18 11:36:21
 * @LastEditors: Roy
 * @LastEditTime: 2022-01-18 11:47:33
 * @Deprecated: 否
 * @FilePath: /blog/src/common/request.js
 */
import axios from 'axios';
const instance = axios.create({
    timeout: 60000
})

instance.interceptors.request.use(function (config) {
    if (config.method.toLocaleLowerCase() === 'post') {
        const token = localStorage.authingToken;
        token && (config.headers.token = token);
    }
    return config;
})

instance.interceptors.response.use(function (response) {
    return response?.data;
})

export default instance;